/*
 * BooksRetail_Connection.java
 * Final Project Example
 * Created on Oct 3, 2014, 09:07:45 PM
 * by Fairul Filza with Team FA_PemrogrammanLanjut
 */

package Database;

// <editor-fold defaultstate="collapsed" desc="Import Code">
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
// </editor-fold>

/** @author PemrogrammanLanjut_LABIV_TI_05~09 */
public class DvdsRetail_Connection {
    private Connection Connector;

    // <editor-fold defaultstate="collapsed" desc="Constructor Code">
    public DvdsRetail_Connection() {
        // do Nothing
    }
    // </editor-fold>

    // <editor-fold defaultstate="collapsed" desc="Getter and Setter Code">
    public Connection getConnector() {
        return Connector;
    }

    public void setConnector(Connection Connector) {
        this.Connector = Connector;
    }
    // </editor-fold>

    // <editor-fold defaultstate="collapsed" desc="Method Code">
    public void Connection() {
        String Url = null;

        try {
            Class.forName("com.mysql.jdbc.Driver");
            try {
                Url = "jdbc:mysql://localhost:3306/DvdsRetail_Datasource";
                Connector = DriverManager.getConnection(Url, "root", "");
            } catch (SQLException Ex) {
                System.out.println("[ERROR] - DvdsRetail_Connection.Connection() " + Ex.getMessage().toString());
            }
        } catch (ClassNotFoundException Ex) {
            System.out.println("[ERROR] - DvdsRetail_Connection.Connection() " + Ex.getMessage().toString());
        }
    }
    // </editor-fold>
}
// End of Code